﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AccesoData;
using Logica.Interfaces;

namespace Logica.Comandos.Ramo
{
    public class ComandoObtenerRamos: Comando, IConsultableLista
    {
        #region Overrides of Comando

        public override void Ejecutar()
        {
            throw new NotImplementedException();
        }

        #endregion

        #region Implementation of IConsultableLista

        public List<object> Ejecutar(object busqueda)
        {
            try
            {
                List<object> retorno = new List<object>();
                foreach (var o in DAO.ObtenerFabrica(1).ObtenerDaoRamo().ObtenerRamos())
                {
                    retorno.Add(o);
                }

                return retorno;
            }
            catch (Exception)
            {

                return null;
            }
        }

        #endregion
    }
}
